/* Rock Paper Scissors Game Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --color-primary-start: #89f7fe; /* Light Blue */
    --color-primary-end: #66a6ff;   /* Royal Blue */
    --color-win: #22c55e;           /* Green */
    --color-lose: #ef4444;          /* Red */
    --color-tie: #6b7280;           /* Gray */
    --color-light: #fff;
    --color-dark: #333;
    --color-light-gray: #eee;
    --color-light-rgb: 255, 255, 255;
    --color-dark-rgb: 51, 51, 51;

    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xs: 0.75rem;
    
    /* Box Shadow */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 20px 40px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 15px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--color-primary-start) 0%, var(--color-primary-end) 100%);
    background-size: 400% 400%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: bgShift 15s ease infinite;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    border-radius: 20px;
    padding: var(--space-xl);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 30px rgba(102, 126, 234, 0.2);
    max-width: 600px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* Header */
.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-light);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: var(--space-sm);
}

.game-subtitle {
    color: var(--color-light-gray);
    font-size: 1.1rem;
}

/* Score Board */
.score-board {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

.score-card {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    min-width: 80px;
    transition: transform 0.3s ease;
}

.score-card:hover {
    transform: translateY(-5px);
}

.player-score {
    background: rgba(34, 197, 94, 0.8);
}

.computer-score {
    background: rgba(239, 68, 68, 0.8);
}

.score-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--color-light);
}

.score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-light);
}

.vs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-light);
    margin: 0 var(--space-md);
}

/* Game Area */
.game-area {
    text-align: center;
    margin-bottom: 2rem;
}

.choice-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    min-height: 120px;
}

.player-choice,
.computer-choice {
    flex: 1;
    padding: 1rem;
}

.choice-display .player-choice {
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.choice-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 1;
}

.choice-display p {
    font-size: 0.9rem;
    color: var(--color-light-gray);
    margin-bottom: 0.3rem;
}

.choice-display h3 {
    font-size: 1.1rem;
    color: var(--color-light);
    font-weight: 600;
}

.result-display {
    padding: 0 1rem;
    min-width: 200px;
}

.result-display h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-light);
    margin: 0;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 15px;
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    min-width: 100px;
    box-shadow: var(--shadow-sm);
}

.choice-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2), 0 0 20px rgba(102, 126, 234, 0.4);
}

.choice-btn:active {
    transform: translateY(0);
}

.choice-btn.selected {
    animation: pulse 0.6s ease-in-out;
}

.emoji {
    font-size: 2rem;
}

.label {
    font-size: 0.9rem;
    color: var(--color-dark);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes bgShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reset Button */
.reset-btn {
    background: linear-gradient(135deg, var(--color-primary-end) 0%, var(--color-primary-start) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: var(--space-xs) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.reset-icon {
    font-size: 1.1rem;
}

/* Round History */
.round-history {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: var(--space-lg);
}

.round-history h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-light);
    margin-bottom: var(--space-md);
    text-align: center;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
    background: rgba(var(--color-light-rgb), 0.5);
    border-radius: 8px;
    font-size: 0.9rem;
    animation: fadeIn 0.5s ease-in;
}

.round-number {
    font-weight: 600;
    color: var(--color-dark);
}

.moves {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.player-move,
.computer-move {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.result {
    font-weight: 600;
}

.win .result {
    color: var(--color-win);
}

.lose .result {
    color: var(--color-lose);
}

.tie .result {
    color: var(--color-tie);
}

.no-history {
    text-align: center;
    color: var(--color-light-gray);
    font-style: italic;
    padding: var(--space-md);
}

/* Shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Respect users' reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .choice-btn.selected,
    .shake {
        animation: none !important;
    }

    .score {
        transition: none !important;
    }
}


/* Responsive Design */
@media (max-width: 600px) {
    .game-container {
        padding: 1.5rem;
        margin: 10px;
    }

    .game-title {
        font-size: 2rem;
    }

    .score-board {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .score-card {
        min-width: auto;
        width: 100%;
    }

    .vs {
        margin: 0;
        order: -1;
    }

    .choice-display {
        flex-direction: column;
        gap: 1rem;
        min-height: auto;
        padding: 1rem;
    }

    .player-choice {
        border-right: none;
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
        padding-bottom: 1rem;
    }

    .computer-choice {
        padding-top: 1rem;
    }

    .controls {
        gap: 0.5rem;
    }

    .choice-btn {
        min-width: 80px;
        padding: 0.75rem 1rem;
    }

    .emoji {
        font-size: 1.5rem;
    }

    .label {
        font-size: 0.8rem;
    }

    .result-display {
        min-width: auto;
        padding: 0;
    }

    .result-display h2 {
        font-size: 1.1rem;
    }

    .round-history {
        padding: 1rem;
    }

    .history-list {
        max-height: 150px;
    }
}

@media (max-width: 400px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }

    .choice-btn {
        width: 100%;
        max-width: 200px;
    }
}